//
//  QQ_MVTableViewCell.m
//  23-QQ音乐
//
//  Created by dllo on 16/8/15.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "QQ_MVTableViewCell.h"
#import "CustomQQCollectionViewCell.h"
#import "MVConllectionList.h"

#define kCollecTionViewReuse @"collecTionViewReuse"
@interface QQ_MVTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@property (weak, nonatomic) IBOutlet UICollectionView *MVColleTionView;



@end

@implementation QQ_MVTableViewCell

- (void)setMvListArr:(NSArray<MVConllectionList *> *)mvListArr {
    _mvListArr = mvListArr;
    [_MVColleTionView reloadData];
}

- (NSInteger) collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return _mvListArr.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    CustomQQCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCollecTionViewReuse forIndexPath:indexPath];
    cell.mvCollectionList = _mvListArr[indexPath.row];
    
    return cell;
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
        return CGSizeMake(CGRectGetWidth(collectionView.bounds) - 10, CGRectGetHeight(collectionView.bounds) / 2 - 15);
    } else {
        return CGSizeMake((CGRectGetWidth(collectionView.bounds) - 15) / 2, CGRectGetHeight(collectionView.bounds) / 4);
    }
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
